//
//  CycleInputView.swift
//  Kosspot
//
//  Created by 李鑫 on 2025/7/18.
//

import SwiftUI

struct CycleInputView: View {
    @Binding var selectedDate: Date
    @Binding var cycleDays: [Date: CycleDay]
    @State private var notes = ""
    @State var isPeriod : Bool = false
    var body: some View {
        VStack {}
//        VStack {
//            Toggle("月经期", isOn: Binding(
//                get: { cycleDays[selectedDate]?.isPeriod ?? false },
//                set: { updateCycleDay(\.isPeriod, $0) }
//            ))
//            Toggle("易孕期", isOn: Binding(
//                get: { cycleDays[selectedDate]?.isFertile ?? false },
//                set: { updateCycleDay(\.isFertile, $0) }
//            ))
//            TextField("备注", text: $notes)
//                .textFieldStyle(RoundedBorderTextFieldStyle())
//        }
//        .padding()
    }
    
//    private func updateCycleDay<T>(_ keyPath: WritableKeyPath<CycleDay, T>, _ value: T) {
//        if cycleDays[selectedDate] == nil {
//            cycleDays[selectedDate] = CycleDay(isPeriod: false,
//                                             isFertile: false,
//                                             notes: "")
//        }
//        cycleDays[selectedDate]?[keyPath: keyPath] = value
//    }
}
